package iwpl.project.entities;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Departments entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Departments")
public class Departments implements java.io.Serializable {

	// Fields

	private Integer id;
	private String departmentName;
	private String address;
	private Integer totalOfFloor;
	private String phone;
	private Set<Offices> officeses = new HashSet<Offices>(0);
	private Set<Areas> areases = new HashSet<Areas>(0);

	// Constructors

	/** default constructor */
	public Departments() {
	}

	/** minimal constructor */
	public Departments(Integer id) {
		this.id = id;
	}

	/** full constructor */
	public Departments(Integer id, String departmentName, String address,
			Integer totalOfFloor, String phone, Set<Offices> officeses,
			Set<Areas> areases) {
		this.id = id;
		this.departmentName = departmentName;
		this.address = address;
		this.totalOfFloor = totalOfFloor;
		this.phone = phone;
		this.officeses = officeses;
		this.areases = areases;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "DepartmentName")
	public String getDepartmentName() {
		return this.departmentName;
	}

	public void setDepartmentName(String departmentName) {
		this.departmentName = departmentName;
	}

	@Column(name = "Address")
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "TotalOfFloor")
	public Integer getTotalOfFloor() {
		return this.totalOfFloor;
	}

	public void setTotalOfFloor(Integer totalOfFloor) {
		this.totalOfFloor = totalOfFloor;
	}

	@Column(name = "Phone", length = 24)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "departments")
	public Set<Offices> getOfficeses() {
		return this.officeses;
	}

	public void setOfficeses(Set<Offices> officeses) {
		this.officeses = officeses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "departments")
	public Set<Areas> getAreases() {
		return this.areases;
	}

	public void setAreases(Set<Areas> areases) {
		this.areases = areases;
	}

}